home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / VIEWEX.PAK / MAINDOC.CPP < prev    next >
C/C++ Source or Header  |  1997-05-06  |  2KB  |  77 lines

  1. // maindoc.cpp : implementation of the CMainDoc class
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1995 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #include "stdafx.h"
  14. #include "viewex.h"
  15.  
  16. #include "enterdlg.h"
  17.  
  18. #ifdef _DEBUG
  19. #undef THIS_FILE
  20. static char BASED_CODE THIS_FILE[] = __FILE__;
  21. #endif
  22.  
  23. /////////////////////////////////////////////////////////////////////////////
  24. // CMainDoc
  25.  
  26. IMPLEMENT_SERIAL(CMainDoc, CDocument, 0 /* schema number*/ )
  27.  
  28. BEGIN_MESSAGE_MAP(CMainDoc, CDocument)
  29.     //{{AFX_MSG_MAP(CMainDoc)
  30.     ON_COMMAND(IDM_CHANGEDATA, OnChangeData)
  31.     //}}AFX_MSG_MAP
  32. END_MESSAGE_MAP()
  33.  
  34. /////////////////////////////////////////////////////////////////////////////
  35. // CMainDoc construction/destruction
  36.  
  37. CMainDoc::CMainDoc()
  38. {
  39. }
  40.  
  41. CMainDoc::~CMainDoc()
  42. {
  43. }
  44.  
  45. BOOL CMainDoc::OnNewDocument()
  46. {
  47.     if (!CDocument::OnNewDocument())
  48.         return FALSE;
  49.     m_strData = "Sample Data String";
  50.     m_colorData = RGB(0, 0, 0);
  51.     return TRUE;
  52. }
  53.  
  54. /////////////////////////////////////////////////////////////////////////////
  55. // CMainDoc serialization
  56.  
  57. void CMainDoc::Serialize(CArchive&)
  58. {
  59.     ASSERT(FALSE);      // this example program does not store data
  60. }
  61.  
  62. /////////////////////////////////////////////////////////////////////////////
  63. // CMainDoc commands
  64.  
  65. void CMainDoc::OnChangeData()
  66. {
  67.     CEnterDlg dlg;
  68.     dlg.m_strInput = m_strData;
  69.     if (dlg.DoModal() != IDOK)
  70.         return;
  71.     m_strData = dlg.m_strInput;
  72.     // if this document stored data then we would call SetModifiedFlag here
  73.     UpdateAllViews(NULL);   // general update
  74. }
  75.  
  76. /////////////////////////////////////////////////////////////////////////////
  77.